package common.model.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 装备位置
 *
 * @author 米泽鹏
 * @since 2023-10-10 下午 11:07
 */
@Getter
public enum EquipmentLocationEnum {

	NONE(0, "/"),

	HAND(1, "手部"),

	BODY(2, "身体"),

	HEAD(3, "头部"),

	BACK(4, "背部"),

	LEG(5, "腿部");


	private final Integer value;

	private final String description;

	EquipmentLocationEnum(Integer value, String description) {
		this.value = value;
		this.description = description;
	}

	public static EquipmentLocationEnum getEnumByValue(Integer code) {
		if (code == null) {
			return null;
		}
		return Arrays.stream(EquipmentLocationEnum.values()).filter(equipmentLocationEnum -> equipmentLocationEnum.value.equals(code)).findFirst().orElse(null);
	}

}
